//
//  DetailsViewController.m
//  LeagueOfLegend
//
//  Created by appying_wxj on 14-7-8.
//  Copyright (c) 2014年 appying_wxj. All rights reserved.
//

#import "DetailsViewController.h"

@interface DetailsViewController ()

@end

@implementation DetailsViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
//    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 64, 320, 0.5)];
//    imageView.backgroundColor = [UIColor redColor];
//    [self.view addSubview:imageView];
    
    [self creatHeard];
    
//    if (version>=7){
//        imageView.frame = CGRectMake(0, 64, 320, 0.5);
//    }else{
//        imageView.frame = CGRectMake(0, 24, 320, 0.5);
//    }

    // Do any additional setup after loading the view.
}

//创建控件
-(void)creatHeard
{
    self.titleLab.text = @"更新简介";
    [self.leftButton setTitle:@"返回" forState:UIControlStateNormal];
    [self.leftButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    //  self.tabBarController.hidesBottomBarWhenPushed = YES;
    [self.leftButton addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    NSString *str = self.textForContext;//获取更新的内容
    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 64, 320, 568-49-30)];
    [webView loadHTMLString:str baseURL:nil];
    webView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:webView];
    
    if (version>=7){
        webView.frame = CGRectMake(0, 64, 320, 568-49-30);
    }else{
        webView.frame = CGRectMake(0, 24, 320, 568-44-20-24-49);
    }
}
-(void)backClick
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
 {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
